package pre.liuxl.blog.repository;

import org.hibernate.Session;

import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate5.HibernateTemplate;
import org.springframework.stereotype.Repository;
import pre.liuxl.blog.entity.RolePermission;
import pre.liuxl.blog.utils.HibernateSessionFactory;


import java.util.List;

/**
 * Created by liuxuanlong on 2018/6/23.
 */
@Repository
public class RolePermissionRepository {
    @Autowired
    HibernateTemplate hibernateTemplate;

    public List<RolePermission> findByRoleId(Integer roleId) {
        RolePermission rolePermission = new RolePermission();
        rolePermission.setRoleId(roleId);
        return hibernateTemplate.findByExample(rolePermission);

    }
}
